<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'
import { CreateElement } from 'vue'
import RenderActionItems from './RenderActionItems.vue'

@Component({
  name: 'RenderAction',
  components: { RenderActionItems }
})
export default class extends Vue {
  // operation buttons
  @Prop({ type: [Array, Object], required: false, default: () => [] })
  private actions: any

  render (h: CreateElement) {
    return h('el-table-column', {
      props: { fixed: 'right', ...this.$attrs },
      scopedSlots: {
        default: ({ row }) =>
          h('RenderActionItems', { props: { row, actions: this.actions } })
      }
    })
  }
}
</script>
